home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / enemy / DeathHead.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  41.9 KB  |  1,244 lines

  1. class classes.enemy.DeathHead
  2. {
  3.    var x;
  4.    var y;
  5.    var clip;
  6.    var fire;
  7.    var transL;
  8.    var transR;
  9.    var colorTrans;
  10.    var eyes;
  11.    var f2;
  12.    var dir;
  13.    var moveScript;
  14.    var axis;
  15.    var xDest;
  16.    var yDest;
  17.    var wallDir;
  18.    var wallC;
  19.    var wallEP;
  20.    var ep;
  21.    var enemyType;
  22.    var darkL;
  23.    var oldF;
  24.    var oldDir;
  25.    var xMov = 0;
  26.    var yMov = 0;
  27.    var xMovT = 0;
  28.    var yMovT = 0;
  29.    var speedOrig = 6;
  30.    var speed = 6;
  31.    var xDestMet = false;
  32.    var yDestMet = false;
  33.    var c = 0;
  34.    var life = 3500;
  35.    var lifeOrig = 3500;
  36.    var nc = 0;
  37.    var xA = 0;
  38.    var yA = 0;
  39.    var nudging = false;
  40.    var hc = 0;
  41.    var power = 30;
  42.    var permitHit = false;
  43.    var phase = 1;
  44.    var cv = 0.25;
  45.    var dark = false;
  46.    var centered = false;
  47.    var cc = 0;
  48.    var Name = "deathHead";
  49.    function DeathHead()
  50.    {
  51.       this.x = 500;
  52.       this.y = 300;
  53.       _root.d = _root.d + 1;
  54.       this.clip = _root.attachMovie("deathHead","deathHeadClip",_root.d + 690000);
  55.       this.clip._x = this.x;
  56.       this.clip._y = this.y;
  57.       this.clip.gotoAndPlay("intro");
  58.       this.fire = new Object();
  59.       this.speed *= _root.dif.speed;
  60.       this.speedOrig = this.speed;
  61.       this.transL = new flash.geom.Transform(this.clip.eyeClip.eyeL);
  62.       this.transR = new flash.geom.Transform(this.clip.eyeClip.eyeR);
  63.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  64.       this.eyes = new Object();
  65.       this.eyes.lO = 0;
  66.       this.eyes.rO = 14;
  67.       this.eyes.c = 0;
  68.       this.eyes.x = 0;
  69.       _root.stats.created = _root.stats.created + 1;
  70.       this.clip.teeth.gotoAndPlay("go");
  71.       this.f2 = "intro";
  72.       _root.lastBoss = true;
  73.    }
  74.    function intro()
  75.    {
  76.       this.c = this.c + 1;
  77.       if(Math.round(this.c / 10) == this.c / 10)
  78.       {
  79.          var _loc3_ = this.c / 10;
  80.          if(_loc3_ > 13)
  81.          {
  82.             _loc3_ = 13;
  83.          }
  84.          this.clip.eyeClip.eyeL.gotoAndStop(_loc3_ + this.eyes.lO);
  85.          this.clip.eyeClip.eyeR.gotoAndStop(_loc3_ + this.eyes.rO);
  86.       }
  87.       if(this.c == 150)
  88.       {
  89.          _root.audio.playLevel2("deathIntro",_root.randRange(20,25));
  90.          _root.audio.playLevel3("deathDrain",_root.randRange(15,20));
  91.          _root.powerUpDrain = new classes.fx.PowerUpDrain(_root[_root.char].x + 3,_root[_root.char].y + 3);
  92.          _root.addFX("powerUpDrain");
  93.          _root[_root.char].weapon = _root.bro1Weapon = _root.bro2Weapon = "laserA";
  94.          _root[_root.char].fireFreq = 11;
  95.          _root[_root.char].fireFreqOrig = 11;
  96.          _root.rapidVar = 4;
  97.       }
  98.       if(this.c > 150 && this.c < 170)
  99.       {
  100.          if(Math.round(this.c / 2) == this.c / 2)
  101.          {
  102.             this.clip.eyeClip.eyeL.blast.gotoAndStop(2);
  103.             this.clip.eyeClip.eyeR.blast.gotoAndStop(2);
  104.             _root[_root.char].colorFlash(255,255,255,2);
  105.          }
  106.          else
  107.          {
  108.             this.clip.eyeClip.eyeL.blast.gotoAndStop(1);
  109.             this.clip.eyeClip.eyeR.blast.gotoAndStop(1);
  110.          }
  111.       }
  112.       if(this.c == 170)
  113.       {
  114.          this.clip.eyeClip.eyeL.blast.gotoAndPlay(2);
  115.          this.clip.eyeClip.eyeR.blast.gotoAndPlay(2);
  116.          this.f2 = "wander";
  117.       }
  118.    }
  119.    function nudge(pxA, pyA, pscale)
  120.    {
  121.       this.nc = 0;
  122.       this.nudging = true;
  123.       var _loc2_ = pscale / 100;
  124.       this.xA = pxA * _loc2_;
  125.       this.yA = pyA * _loc2_;
  126.    }
  127.    function speedVar()
  128.    {
  129.       if(random(3) == 1)
  130.       {
  131.          this.speed *= _root.randRange2(0.9,1.1);
  132.       }
  133.       if(this.speed >= this.speedOrig * 1.3)
  134.       {
  135.          this.speed = this.speedOrig;
  136.       }
  137.    }
  138.    function parseMoveScript()
  139.    {
  140.       this.dir = this.moveScript[0];
  141.       if(this.dir == "break")
  142.       {
  143.          delete this.moveScript;
  144.       }
  145.       else
  146.       {
  147.          this[this.axis + "MovT"] = 0;
  148.          this.f2 = "gotoXYDest";
  149.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  150.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  151.          this.speedVar();
  152.          if(this.dir == "L" || this.dir == "U")
  153.          {
  154.             this[this.axis + "Dest"] = this[this.axis] - this.moveScript[1];
  155.          }
  156.          else
  157.          {
  158.             this[this.axis + "Dest"] = this[this.axis] + this.moveScript[1];
  159.          }
  160.          this.moveScript.splice(0,2);
  161.       }
  162.    }
  163.    function gotoXYDest()
  164.    {
  165.       if(Math.abs(this[this.axis + "Dest"] - this[this.axis]) < this.speed + 1)
  166.       {
  167.          if(this.axis == "x")
  168.          {
  169.             this.x = this.xDest;
  170.          }
  171.          else
  172.          {
  173.             this.y = this.yDest;
  174.          }
  175.          this.parseMoveScript();
  176.       }
  177.    }
  178.    function getDirString()
  179.    {
  180.       if(this.xMovT < -1)
  181.       {
  182.          this.dir = "L";
  183.       }
  184.       else if(this.xMovT > 1)
  185.       {
  186.          this.dir = "R";
  187.       }
  188.       else if(this.yMovT > 1)
  189.       {
  190.          this.dir = "D";
  191.       }
  192.       else if(this.yMovT < -1)
  193.       {
  194.          this.dir = "U";
  195.       }
  196.    }
  197.    function wander()
  198.    {
  199.       if(random(100) > 70 || (this.x > 950 || this.x < 50 || this.y < 50 || this.y > 550))
  200.       {
  201.          if(random(50) > 48)
  202.          {
  203.             this.wait();
  204.          }
  205.          else if(random(10) > 1)
  206.          {
  207.             this.dir = _root.getDir(this.x,this.y);
  208.             this[this.axis + "MovT"] = 0;
  209.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  210.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  211.             this.speedVar();
  212.          }
  213.          else
  214.          {
  215.             this[this.axis + "MovT"] = 0;
  216.             this.axis = random(10) <= 4 ? "y" : "x";
  217.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  218.             this.getDirString();
  219.          }
  220.       }
  221.       if(this.phase < 6)
  222.       {
  223.          if(random(200) > 197 + _root.dif.wait)
  224.          {
  225.             if(random(7) == 0 && !this.dark)
  226.             {
  227.                this.darkness();
  228.             }
  229.             else if(random(5) > 0)
  230.             {
  231.                this.fireLaser();
  232.             }
  233.             else if(!this.dark)
  234.             {
  235.                this.astroAttack();
  236.             }
  237.          }
  238.       }
  239.       else if(random(200) > 196 + _root.dif.wait)
  240.       {
  241.          if(random(2) > 0 && _root.chars.length < 4)
  242.          {
  243.             this.blackEnemies();
  244.          }
  245.          else if(random(3) > 0)
  246.          {
  247.             this.deathBallAttack();
  248.          }
  249.          else if(random(2) > 0)
  250.          {
  251.             this.fireLaser();
  252.          }
  253.          else if(this.x > 200 && this.x < 800)
  254.          {
  255.             this.wall();
  256.          }
  257.       }
  258.    }
  259.    function wall()
  260.    {
  261.       this.permitHit = false;
  262.       this.wallDir = random(2) != 0 ? "D" : "U";
  263.       this.xMovT = 0;
  264.       this.yMovT = 0;
  265.       this.f2 = "walling";
  266.       this.c = 0;
  267.       this.wallC = 0;
  268.       this.wallEP = _root.randRange(3,7);
  269.       this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,255,160,0,0);
  270.       this.transL.colorTransform = this.colorTrans;
  271.       this.transR.colorTransform = this.colorTrans;
  272.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  273.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  274.       _root.audio.playLevel2("deathWall",_root.randRange(15,20));
  275.    }
  276.    function walling()
  277.    {
  278.       this.c = this.c + 1;
  279.       if(this.c < 150)
  280.       {
  281.          var _loc5_ = this.wallDir != "U" ? 0.5 : -0.5;
  282.       }
  283.       else
  284.       {
  285.          _loc5_ = this.wallDir != "U" ? -0.5 : 0.5;
  286.       }
  287.       this.yMov = this.yMovT += _loc5_;
  288.       if(this.c == 300)
  289.       {
  290.          this.permitHit = true;
  291.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  292.          this.transL.colorTransform = this.colorTrans;
  293.          this.transR.colorTransform = this.colorTrans;
  294.          this.f2 = "wander";
  295.          if(this.y > 650)
  296.          {
  297.             this.y = -40;
  298.          }
  299.          if(this.y < -50)
  300.          {
  301.             this.y = 620;
  302.          }
  303.       }
  304.       this.wallC = this.wallC + 1;
  305.       if(this.wallC >= this.wallEP)
  306.       {
  307.          var _loc3_ = this.x <= _root[_root.char].x ? "R" : "L";
  308.          var _loc6_ = _loc3_ != "R" ? -21 : 21;
  309.          _root.enemyShotID = _root.enemyShotID + 1;
  310.          _root["bugASwitchBlast" + _root.enemyShotID] = new classes.shots.BugASwitchBlast(this.x + _loc6_,this.y + 21,_loc3_,_root.enemyShotID,true);
  311.          _root.addEnemyShot("bugASwitchBlast" + _root.enemyShotID);
  312.          _root.audio.playLevel3("deathWallFire" + (random(3) + 1),_root.randRange(12,16));
  313.          this.wallEP = _root.randRange(3,7);
  314.          this.wallC = 0;
  315.       }
  316.       if(this.c > 45 && this.c < 245)
  317.       {
  318.          if(random(4) == 0)
  319.          {
  320.             var _loc4_ = this.x <= _root[_root.char].x ? 2 : 1;
  321.             _root.fxID = _root.fxID + 1;
  322.             _root["deathWallFX" + _root.fxID] = new classes.fx.DeathWallFX(this.x,this.y,this.wallDir,_loc4_,_root.fxID);
  323.             _root.addFX("deathWallFX" + _root.fxID);
  324.          }
  325.       }
  326.    }
  327.    function blackEnemies()
  328.    {
  329.       this.cc = 0;
  330.       this.ep = _root.randRange(8,30);
  331.       this.f2 = "creatingEnemies";
  332.       this.enemyType = _root.randRange(1,4);
  333.       _root.audio.playLevel2("deathEnemyLaunch",_root.randRange(20,25));
  334.    }
  335.    function creatingEnemies()
  336.    {
  337.       this.cc = this.cc + 1;
  338.       this.xA = _root.randRange2(-3,3);
  339.       this.yA = _root.randRange2(-3,3);
  340.       var _loc3_ = ["L","R","U","D"];
  341.       if(Math.round(this.cc / 2) == this.cc / 2)
  342.       {
  343.          this["createEnemy" + this.enemyType](_loc3_[random(4)]);
  344.       }
  345.       if(this.cc >= this.ep)
  346.       {
  347.          this.f2 = "wander";
  348.          this.xA = this.yA = 0;
  349.       }
  350.    }
  351.    function deathBallAttack()
  352.    {
  353.       _root.audio.playLevel2("deathBallLaunch",_root.randRange(12,18));
  354.       this.cc = 0;
  355.       this.ep = _root.randRange(10,26);
  356.       this.f2 = "deathBallAttacking";
  357.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  358.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  359.    }
  360.    function deathBallAttacking()
  361.    {
  362.       this.cc = this.cc + 1;
  363.       if(Math.round(this.cc / 2) == this.cc / 2)
  364.       {
  365.          this.deathBall();
  366.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,_root.randRange(-150,150),_root.randRange(-10,10),_root.randRange(-10,10),0);
  367.          this.transL.colorTransform = this.colorTrans;
  368.          this.transR.colorTransform = this.colorTrans;
  369.       }
  370.       if(this.cc >= this.ep)
  371.       {
  372.          this.f2 = "wander";
  373.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  374.          this.transL.colorTransform = this.colorTrans;
  375.          this.transR.colorTransform = this.colorTrans;
  376.       }
  377.    }
  378.    function deathBall()
  379.    {
  380.       _root.enemyShotID = _root.enemyShotID + 1;
  381.       _root["deathBall" + _root.enemyShotID] = new classes.shots.DeathBall(this.x,this.y,this.xMov * -1,this.yMov * -1,_root.enemyShotID);
  382.       _root.addEnemyShot("deathBall" + _root.enemyShotID);
  383.    }
  384.    function darkness()
  385.    {
  386.       this.f2 = "darkening";
  387.       this.dark = true;
  388.       this.c = 0;
  389.       _root.attachMovie("deathDark","deathDarkClip",25);
  390.       _root.deathDarkClip._x = 0;
  391.       _root.deathDarkClip._y = 0;
  392.       this.darkL = _root.randRange(150,240);
  393.       this.speed *= 1.5;
  394.       _root.audio.playLevel2("deathDark2",_root.randRange(20,25));
  395.    }
  396.    function darkening()
  397.    {
  398.       this.c = this.c + 1;
  399.       if(random(100) > 50 || (this.x > 950 || this.x < 50 || this.y < 50 || this.y > 550))
  400.       {
  401.          if(random(10) > 1)
  402.          {
  403.             this.dir = _root.getDir(this.x,this.y);
  404.             this[this.axis + "MovT"] = 0;
  405.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  406.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  407.             this.speedVar();
  408.          }
  409.          else
  410.          {
  411.             this[this.axis + "MovT"] = 0;
  412.             this.axis = random(10) <= 4 ? "y" : "x";
  413.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  414.             this.getDirString();
  415.          }
  416.       }
  417.       if(this.c < 26)
  418.       {
  419.          if(Math.round(this.c / 2) == this.c / 2)
  420.          {
  421.             var _loc3_ = this.c / 2;
  422.             if(_loc3_ > 13)
  423.             {
  424.                _loc3_ = 13;
  425.             }
  426.             this.clip.eyeClip.eyeL.gotoAndStop(_loc3_ + this.eyes.lO);
  427.             this.clip.eyeClip.eyeR.gotoAndStop(_loc3_ + this.eyes.rO);
  428.          }
  429.          this.clip.cover._alpha = 100 - this.c * 4;
  430.       }
  431.       if(this.c > 25)
  432.       {
  433.          this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  434.          this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  435.       }
  436.       if(this.c == 30)
  437.       {
  438.          _root.deathDarkClip.play();
  439.          this.clip.cover._alpha = 0;
  440.       }
  441.       if(this.c > 30 && this.c < 60)
  442.       {
  443.          var _loc5_ = 1 - (this.c - 30) / 30;
  444.          var _loc4_ = - (this.c - 30) * 8.5;
  445.          this.colorTrans = new flash.geom.ColorTransform(_loc5_,_loc5_,_loc5_,1,_loc4_,_loc4_,_loc4_,0);
  446.          this.transL.colorTransform = this.colorTrans;
  447.          this.transR.colorTransform = this.colorTrans;
  448.       }
  449.       if(this.c > 60 && this.c < 90)
  450.       {
  451.          _loc5_ = (this.c - 60) / 30;
  452.          _loc4_ = -255 + (this.c - 60) * 8.5;
  453.          this.colorTrans = new flash.geom.ColorTransform(_loc5_,_loc5_,_loc5_,1,_loc4_,_loc4_,_loc4_,0);
  454.          this.transL.colorTransform = this.colorTrans;
  455.          this.transR.colorTransform = this.colorTrans;
  456.       }
  457.       if(_root.deathDarkClip.end)
  458.       {
  459.          _root.deathDarkClip.removeMovieClip();
  460.          this.clip.cover._alpha = 100;
  461.          this.dark = false;
  462.          this.f2 = "wander";
  463.          this.speed = this.speedOrig;
  464.       }
  465.    }
  466.    function astroAttack()
  467.    {
  468.       this.f2 = "astroAttacking";
  469.       this.c = 0;
  470.       this.xMovT = 0;
  471.       this.yMovT = 0;
  472.       var _loc4_ = 0;
  473.       var _loc5_ = _root.randRange(5,9);
  474.       while(_loc4_ < _loc5_)
  475.       {
  476.          var _loc3_ = random(4);
  477.          _root.fxID = _root.fxID + 1;
  478.          _root["asteroidD" + _root.fxID] = new classes.fx.AsteroidD(_root.randRange(_root.posArray[_loc3_][0],_root.posArray[_loc3_][1]),_root.randRange(_root.posArray[_loc3_][2],_root.posArray[_loc3_][3]),_root.randRange(4,5),_root.dirArray[_loc3_],_root.fxID);
  479.          _root.addFX("asteroidD" + _root.fxID);
  480.          _loc4_ = _loc4_ + 1;
  481.       }
  482.    }
  483.    function astroAttacking()
  484.    {
  485.       this.c = this.c + 1;
  486.       if(this.c < 30)
  487.       {
  488.          if(Math.round(this.c / 2) == this.c / 2)
  489.          {
  490.             var _loc5_ = this.c / 2;
  491.             if(_loc5_ > 13)
  492.             {
  493.                _loc5_ = 13;
  494.             }
  495.             this.clip.eyeClip.eyeL.gotoAndStop(_loc5_ + this.eyes.lO);
  496.             this.clip.eyeClip.eyeR.gotoAndStop(_loc5_ + this.eyes.rO);
  497.          }
  498.       }
  499.       if(this.c > 45 && this.c < 65)
  500.       {
  501.          var _loc6_ = this.c >= 55 ? 1 - (this.c - 54) / 10 : (this.c - 45) / 10;
  502.          this.xA = _root.randRange2(-6,6) * _loc6_;
  503.          this.yA = _root.randRange2(-6,6) * _loc6_;
  504.       }
  505.       if(this.c == 55)
  506.       {
  507.          _root.audio.playLevel2("deathAstCrush",_root.randRange(40,50));
  508.          var _loc3_ = 0;
  509.          var _loc4_ = _root.FX.length;
  510.          while(_loc3_ < _loc4_)
  511.          {
  512.             _root[_root.FX[_loc3_]].explode();
  513.             _loc3_ = _loc3_ + 1;
  514.          }
  515.       }
  516.       if(this.c == 65)
  517.       {
  518.          this.xA = this.yA = 0;
  519.       }
  520.       if(this.c == 68)
  521.       {
  522.          _root.audio.playLevel2("deathAstGuide",_root.randRange(24,29));
  523.          _loc3_ = 0;
  524.          _loc4_ = _root.FX.length;
  525.          while(_loc3_ < _loc4_)
  526.          {
  527.             _root[_root.FX[_loc3_]].stopMov();
  528.             _loc3_ = _loc3_ + 1;
  529.          }
  530.       }
  531.       if(this.c == 78)
  532.       {
  533.          _loc3_ = 0;
  534.          _loc4_ = _root.FX.length;
  535.          while(_loc3_ < _loc4_)
  536.          {
  537.             _root[_root.FX[_loc3_]].attack();
  538.             _loc3_ = _loc3_ + 1;
  539.          }
  540.       }
  541.       if(this.c == 90)
  542.       {
  543.          this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  544.          this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  545.          this.oldF = this.clip.eyeClip.eyeL._currentframe - this.eyes.lO;
  546.          this.f2 = "wander";
  547.       }
  548.    }
  549.    function wait()
  550.    {
  551.       this[this.axis + "MovT"] = 0;
  552.       this.f2 = "waiting";
  553.       this.c = 0;
  554.       this.ep = _root.randRange(30,120);
  555.       this.ep *= 1 / _root.dif.speed;
  556.       this.clip.teeth.gotoAndStop("stop");
  557.    }
  558.    function waiting()
  559.    {
  560.       this.c = this.c + 1;
  561.       if(this.c >= this.ep)
  562.       {
  563.          this.f2 = "wander";
  564.          this.clip.teeth.gotoAndPlay("go");
  565.          if(random(10) > 2)
  566.          {
  567.             this.dir = _root.getDir(this.x,this.y);
  568.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  569.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  570.             this.speedVar();
  571.          }
  572.          else
  573.          {
  574.             this.axis = random(10) <= 4 ? "y" : "x";
  575.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  576.             this.getDirString();
  577.          }
  578.       }
  579.    }
  580.    function fireLaser()
  581.    {
  582.       this.xMovT = 0;
  583.       this.yMovT = 0;
  584.       this.fire.c = 0;
  585.       this.f2 = "firing";
  586.       _root.audio.playLevel3("deathLaserFire",_root.randRange(15,20));
  587.       this.fire.eyesA = 100;
  588.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  589.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  590.       this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,-255,-255,-255,0);
  591.       this.transL.colorTransform = this.colorTrans;
  592.       this.transR.colorTransform = this.colorTrans;
  593.    }
  594.    function firing()
  595.    {
  596.       this.fire.c = this.fire.c + 1;
  597.       if(this.fire.c < 15)
  598.       {
  599.          if(this.fire.eyesA == 0)
  600.          {
  601.             this.fire.eyesA = 100;
  602.             this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  603.          }
  604.          else
  605.          {
  606.             this.colorTrans = new flash.geom.ColorTransform(0,0,0,1,-255,-255,-255,0);
  607.             this.fire.eyesA = 0;
  608.          }
  609.          this.transL.colorTransform = this.colorTrans;
  610.          this.transR.colorTransform = this.colorTrans;
  611.       }
  612.       if(this.fire.c == 15)
  613.       {
  614.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  615.          this.transL.colorTransform = this.colorTrans;
  616.          this.transR.colorTransform = this.colorTrans;
  617.          this.clip.eyeClip.eyeL.blast.play();
  618.          this.clip.eyeClip.eyeR.blast.play();
  619.          var _loc3_ = _root.getDir(this.x,this.y);
  620.          if(_loc3_ == "L")
  621.          {
  622.             var _loc4_ = this.x - 51;
  623.             var _loc5_ = this.y + 6;
  624.          }
  625.          else if(_loc3_ == "R")
  626.          {
  627.             _loc4_ = this.x + 21;
  628.             _loc5_ = this.y + 6;
  629.          }
  630.          else if(_loc3_ == "U")
  631.          {
  632.             _loc4_ = this.x + 12;
  633.             _loc5_ = this.y - 51;
  634.          }
  635.          else
  636.          {
  637.             _loc4_ = this.x + 12;
  638.             _loc5_ = this.y + 15;
  639.          }
  640.          _root.enemyShotID = _root.enemyShotID + 1;
  641.          _root["deathLaser" + _root.enemyShotID] = new classes.shots.DeathLaser(_loc4_,_loc5_,_loc3_,true,_root.enemyShotID);
  642.          _root.addEnemyShot("deathLaser" + _root.enemyShotID);
  643.       }
  644.       if(this.fire.c == 16)
  645.       {
  646.          this.f2 = "wander";
  647.          if(random(10) > 2)
  648.          {
  649.             this.dir = _root.getDir(this.x,this.y);
  650.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  651.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  652.             this.speedVar();
  653.          }
  654.          else
  655.          {
  656.             this.axis = random(10) <= 4 ? "y" : "x";
  657.             this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  658.             this.getDirString();
  659.          }
  660.       }
  661.    }
  662.    function death()
  663.    {
  664.       this.phase = 7;
  665.       _root.playBGSound(["deathLoop",0,6,0.05]);
  666.       _root[_root.char].xA = _root[_root.char].yA = 0;
  667.       _root.stats.destroyed = _root.stats.destroyed + 1;
  668.       _root.stats.score += 100000;
  669.       var _loc3_ = 1;
  670.       var _loc5_ = _root.chars.length;
  671.       while(_loc3_ < _loc5_)
  672.       {
  673.          _root[_root.chars[_loc3_]].bombed(100);
  674.          _loc3_ = _loc3_ + 1;
  675.       }
  676.       var _loc4_ = _root.enemyShots.slice();
  677.       _loc3_ = 0;
  678.       _loc5_ = _loc4_.length;
  679.       while(_loc3_ < _loc5_)
  680.       {
  681.          _root.removeEnemyShot(_loc4_[_loc3_]);
  682.          _loc3_ = _loc3_ + 1;
  683.       }
  684.       this.f2 = "dying";
  685.       this.c = 0;
  686.       this.speed = this.speedOrig = 3;
  687.       this.cv = 1;
  688.       this.clip.eyeClip.gotoAndPlay(20);
  689.       this.clip.gotoAndPlay("spin");
  690.       this.clip.swapDepths(_root.d + 9999);
  691.    }
  692.    function dying()
  693.    {
  694.       this.c = this.c + 1;
  695.       if(this.c == 1)
  696.       {
  697.          var _loc9_ = _root.getAngleRad2(this.x,this.y,500,300);
  698.          var _loc10_ = _root.getDist2(this.x,this.y,500,300);
  699.          var _loc8_ = _loc10_ >= 100 ? (_loc10_ + 200) / 300 : 1;
  700.          this.xMovT = Math.cos(_loc9_) * this.speed * _loc8_;
  701.          this.yMovT = Math.sin(_loc9_) * this.speed * _loc8_;
  702.       }
  703.       if(this.c == 15)
  704.       {
  705.          var _loc4_ = _root.powerUps.slice();
  706.          var _loc3_ = 0;
  707.          var _loc5_ = _loc4_.length;
  708.          while(_loc3_ < _loc5_)
  709.          {
  710.             _root.removePowerUp(_loc4_[_loc3_]);
  711.             _loc3_ = _loc3_ + 1;
  712.          }
  713.          _loc9_ = _root.getAngleRad2(this.x,this.y,500,300);
  714.          _loc10_ = _root.getDist2(this.x,this.y,500,300);
  715.          _loc8_ = _loc10_ >= 100 ? (_loc10_ + 200) / 300 : 1;
  716.          this.xMovT = Math.cos(_loc9_) * this.speed * _loc8_;
  717.          this.yMovT = Math.sin(_loc9_) * this.speed * _loc8_;
  718.       }
  719.       if(this.x > 400 && this.x < 600 && (this.y > 200 && this.y < 400) && !this.centered && this.c > 15)
  720.       {
  721.          this.centered = true;
  722.          var _loc6_ = this.x <= _root[_root.char].x ? "R" : "L";
  723.          var _loc7_ = _loc6_ != "L" ? -40 : 1020;
  724.          if(_root[_root.char2].tagTeaming)
  725.          {
  726.             _loc6_ = _root[_root.char2].x >= 500 ? "L" : "R";
  727.             _root[_root.char2].endSeq(_loc6_);
  728.          }
  729.          else if(_root.char2 == "bro1")
  730.          {
  731.             _root.bro1 = new classes.bro.Bro1(_loc7_,150);
  732.             _root.addChar("bro1");
  733.             _root.bro1.endSeq(_loc6_);
  734.          }
  735.          else if(_root.char2 == "bro2")
  736.          {
  737.             _root.bro2 = new classes.bro.Bro2(_loc7_,250);
  738.             _root.addChar("bro2");
  739.             _root.bro2.endSeq(_loc6_);
  740.          }
  741.          else if(_root.char2 == "broShip1")
  742.          {
  743.             _root.bro1ShipLevel = 3;
  744.             _root.broShip1 = new classes.bro.BroShip1(_loc7_,350);
  745.             _root.addChar("broShip1");
  746.             _root.broShip1.endSeq(_loc6_);
  747.          }
  748.          else if(_root.char2 == "broShip2")
  749.          {
  750.             _root.bro2ShipLevel = 3;
  751.             _root.broShip2 = new classes.bro.BroShip2(_loc7_,450);
  752.             _root.addChar("broShip2");
  753.             _root.broShip2.endSeq(_loc6_);
  754.          }
  755.          if(this.xMov > 10 || this.yMov > 10)
  756.          {
  757.             this.cv = 5;
  758.          }
  759.          else
  760.          {
  761.             this.cv = 0.5;
  762.          }
  763.          this.xMovT = 0;
  764.          this.yMovT = 0;
  765.       }
  766.       if(Math.round(this.c / 30) == this.c / 30 && this.c > 90 && this.c < 300)
  767.       {
  768.          _root[_root.char2].endSeqB();
  769.       }
  770.       if(this.c == 240)
  771.       {
  772.          _root[_root.char2].fireDir = "";
  773.       }
  774.       if(this.c == 280)
  775.       {
  776.          this.clip.gotoAndStop("F");
  777.          this.clip.eyeClip.gotoAndStop(60);
  778.          this.clip.eyeClip._visible = true;
  779.       }
  780.       if(this.c == 300)
  781.       {
  782.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,100),_root.randRange(90,100),"Red"]);
  783.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,80),_root.randRange(90,100),"Yellow"]);
  784.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(-20,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(40,80),_root.randRange(50,80),"Yellow"]);
  785.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(-20,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(40,70),_root.randRange(50,80),"Red"]);
  786.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,100),_root.randRange(90,100),"Red"]);
  787.          _root.createExploA([this.x + this.clip.eyeClip._x + _root.randRange(0,40),this.y + this.clip.eyeClip._y + _root.randRange(-10,10),_root.randRange(50,80),_root.randRange(90,100),"Yellow"]);
  788.          this.clip.eyeClip._visible = false;
  789.          this.clip.gotoAndStop("F");
  790.          this.clip.skull._visible = false;
  791.          _root.audio.playLevel2("deathEyeX",_root.randRange(15,25));
  792.       }
  793.       if(this.c == 360)
  794.       {
  795.          _root.audio.playLevel2("deathHeadX",30);
  796.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  797.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  798.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  799.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  800.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  801.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  802.          _root.createExploD([this.x + _root.randRange(-80,80),this.y + this.clip._height / 3 + _root.randRange(-80,80),_root.randRange(50,150),_root.randRange(60,100)]);
  803.          _root.createExploD([this.x + 18,this.y + 18,_root.randRange(180,250),_root.randRange(90,100)]);
  804.          _loc3_ = 0;
  805.          _loc5_ = _root.randRange(6,10);
  806.          while(_loc3_ < _loc5_)
  807.          {
  808.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"bugA","red",true,true]);
  809.             _loc3_ = _loc3_ + 1;
  810.          }
  811.          _loc3_ = 0;
  812.          _loc5_ = _root.randRange(6,10);
  813.          while(_loc3_ < _loc5_)
  814.          {
  815.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"batB","green",true,true]);
  816.             _loc3_ = _loc3_ + 1;
  817.          }
  818.          _loc3_ = 0;
  819.          _loc5_ = _root.randRange(6,10);
  820.          while(_loc3_ < _loc5_)
  821.          {
  822.             _root.createShrapnel([this.x + this.clip._width / 2,this.y + this.clip._height / 2,"droidA","blue",true,true]);
  823.             _loc3_ = _loc3_ + 1;
  824.          }
  825.          _root.audio.playLevel4("deathHeadX",_root.randRange(15,25));
  826.          this.clip.skull._visible = true;
  827.          this.clip.skull.gotoAndPlay("end");
  828.          this.clip.head._visible = false;
  829.          this.clip.teeth._visible = false;
  830.          this.clip.cover._visible = false;
  831.       }
  832.       if(this.c > 360)
  833.       {
  834.          _root.bgDecoClip._alpha--;
  835.          this.clip.skull._alpha -= 1;
  836.          this.clip._y -= 0.5;
  837.       }
  838.       if(this.c > 360 && this.c < 420)
  839.       {
  840.          _root[_root.char].xA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  841.          _root[_root.char2].xA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  842.          _root[_root.char].yA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  843.          _root[_root.char2].yA = _root.randRange2(-5,5) * ((420 - this.c) / 60);
  844.       }
  845.       if(this.c == 450)
  846.       {
  847.          _root.bgDecoClip.removeMovieClip();
  848.          _root.endSeq();
  849.       }
  850.       if(this.c == 560)
  851.       {
  852.          _root.removeChar("deathHead");
  853.       }
  854.    }
  855.    function createEnemy1(dir)
  856.    {
  857.       _root.charID = _root.charID + 1;
  858.       _root["droidD" + _root.charID] = new classes.enemy.DroidD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  859.       _root.addChar("droidD" + _root.charID);
  860.    }
  861.    function createEnemy2(dir)
  862.    {
  863.       _root.charID = _root.charID + 1;
  864.       _root["batD" + _root.charID] = new classes.enemy.BatD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  865.       _root.addChar("batD" + _root.charID);
  866.    }
  867.    function createEnemy3(dir)
  868.    {
  869.       _root.charID = _root.charID + 1;
  870.       _root["headD" + _root.charID] = new classes.enemy.HeadD(this.x + 12,this.y + 12,[dir,100,"break"],_root.charID);
  871.       _root.addChar("headD" + _root.charID);
  872.    }
  873.    function createEnemy4(dir)
  874.    {
  875.       _root.charID = _root.charID + 1;
  876.       _root["bugD" + _root.charID] = new classes.enemy.BugD(this.x + 6,this.y + 6,[dir,100,"break"],_root.charID);
  877.       _root.addChar("bugD" + _root.charID);
  878.    }
  879.    function changePhase(pphase)
  880.    {
  881.       this.phase = pphase;
  882.       if(this.phase == 5)
  883.       {
  884.          this.fury();
  885.       }
  886.    }
  887.    function fury2()
  888.    {
  889.       _root.audio.playLevel2("deathFury" + (random(2) + 2),_root.randRange(30,35));
  890.       this.f2 = "furious2";
  891.       this.c = 0;
  892.       this.ep = _root.randRange(20,60);
  893.       this.speed = this.speedOrig * 4;
  894.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  895.       this.transL.colorTransform = this.colorTrans;
  896.       this.transR.colorTransform = this.colorTrans;
  897.       _root.audio.playLevel2("deathFury2",_root.randRange(30,35));
  898.       if(random(2) == 0)
  899.       {
  900.          this.dir = _root.getDir(this.x,this.y);
  901.          this[this.axis + "MovT"] = 0;
  902.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  903.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  904.       }
  905.    }
  906.    function furious2()
  907.    {
  908.       this.colorTrans = new flash.geom.ColorTransform(1,_root.randRange2(0,0.2),0,1,_root.randRange(150,255),_root.randRange(0,30),0,0);
  909.       this.transL.colorTransform = this.colorTrans;
  910.       this.transR.colorTransform = this.colorTrans;
  911.       if(random(25 + _root.dif.wait * 2) == 0)
  912.       {
  913.          _root.enemyShotID = _root.enemyShotID + 1;
  914.          _root["deathFizzle" + _root.enemyShotID] = new classes.shots.DeathFizzle(this.x,this.y,_root.enemyShotID);
  915.          _root.addEnemyShot("deathFizzle" + _root.enemyShotID);
  916.          _root.audio.playLevel3("deathFizzle" + (random(3) + 1),_root.randRange(10,18));
  917.       }
  918.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  919.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  920.       if(random(5) == 0)
  921.       {
  922.          this.dir = _root.getDir(this.x,this.y);
  923.          this[this.axis + "MovT"] = 0;
  924.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  925.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  926.       }
  927.       this.cv = 0.75 + _root.getDist(this.x,this.y) / 750;
  928.       this.c = this.c + 1;
  929.       if(this.c >= this.ep)
  930.       {
  931.          this.f2 = "wander";
  932.          this.cv = 0.3;
  933.          this.speed = this.speedOrig;
  934.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  935.          this.transL.colorTransform = this.colorTrans;
  936.          this.transR.colorTransform = this.colorTrans;
  937.       }
  938.    }
  939.    function fury()
  940.    {
  941.       this.f2 = "furious";
  942.       this.c = 0;
  943.       this.ep = _root.randRange(450,750);
  944.       this.speed = this.speedOrig * 4;
  945.       this.colorTrans = new flash.geom.ColorTransform(1,0,0,1,255,0,0,0);
  946.       this.transL.colorTransform = this.colorTrans;
  947.       this.transR.colorTransform = this.colorTrans;
  948.       _root.audio.playLevel2("deathFury",_root.randRange(39,45));
  949.       _root.playBGSound(["deathTheme",50,3,0.05]);
  950.    }
  951.    function furious()
  952.    {
  953.       this.colorTrans = new flash.geom.ColorTransform(1,_root.randRange2(0,0.2),0,1,_root.randRange(150,255),_root.randRange(0,30),0,0);
  954.       this.transL.colorTransform = this.colorTrans;
  955.       this.transR.colorTransform = this.colorTrans;
  956.       if(random(25 + _root.dif.wait * 2) == 0)
  957.       {
  958.          _root.enemyShotID = _root.enemyShotID + 1;
  959.          _root["deathFizzle" + _root.enemyShotID] = new classes.shots.DeathFizzle(this.x,this.y,_root.enemyShotID);
  960.          _root.addEnemyShot("deathFizzle" + _root.enemyShotID);
  961.          _root.audio.playLevel3("deathFizzle" + (random(3) + 1),_root.randRange(10,18));
  962.       }
  963.       this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  964.       this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  965.       if(random(6) == 0)
  966.       {
  967.          this.dir = _root.getDir(this.x,this.y);
  968.          this[this.axis + "MovT"] = 0;
  969.          this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  970.          this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  971.       }
  972.       this.cv = 0.75 + _root.getDist(this.x,this.y) / 750;
  973.       this.c = this.c + 1;
  974.       if(this.c >= this.ep)
  975.       {
  976.          this.permitHit = true;
  977.          _root.level = 5;
  978.          this.f2 = "wander";
  979.          this.phase = 6;
  980.          this.cv = 0.3;
  981.          this.speed = this.speedOrig;
  982.          this.speed += 1;
  983.          this.speedOrig = this.speed;
  984.          this.colorTrans = new flash.geom.ColorTransform(1,1,1,1,0,0,0,0);
  985.          this.transL.colorTransform = this.colorTrans;
  986.          this.transR.colorTransform = this.colorTrans;
  987.       }
  988.       if(_root.deathDarkClip.end)
  989.       {
  990.          _root.deathDarkClip.removeMovieClip();
  991.          this.clip.cover._alpha = 100;
  992.          this.dark = false;
  993.       }
  994.    }
  995.    function main()
  996.    {
  997.       this[this.f2]();
  998.       if(this.oldDir != this.dir && this.f2 != "intro")
  999.       {
  1000.          this.clip.gotoAndStop(this.dir);
  1001.       }
  1002.       this.oldDir = this.dir;
  1003.       if(this.phase == 6)
  1004.       {
  1005.          var _loc12_ = _root.getAngleRad(this.x,this.y);
  1006.          _root[_root.char].xA = Math.cos(_loc12_) * (-1 * this.speed / 8);
  1007.          _root[_root.char].yA = Math.sin(_loc12_) * (-1 * this.speed / 8);
  1008.       }
  1009.       if(this.f2 != "dying")
  1010.       {
  1011.          if(this.f2 == "wander" || this.f2 == "waiting" && this.phase != 6)
  1012.          {
  1013.             var _loc11_ = _root.getDist(this.x,this.y);
  1014.             var _loc8_ = 0;
  1015.             if(_loc11_ >= 400)
  1016.             {
  1017.                _loc8_ = 1;
  1018.             }
  1019.             else if(_loc11_ <= 100)
  1020.             {
  1021.                _loc8_ = 13;
  1022.             }
  1023.             else
  1024.             {
  1025.                _loc8_ = Math.ceil((400 - _loc11_) / 23);
  1026.                if(random(4) == 0)
  1027.                {
  1028.                   _loc8_ += _root.randRange(-1,1);
  1029.                }
  1030.             }
  1031.             if(_loc8_ + 1 < this.oldF)
  1032.             {
  1033.                _loc8_ = this.oldF - 1;
  1034.             }
  1035.             else if(this.oldF + 1 < _loc8_)
  1036.             {
  1037.                _loc8_ = this.oldF + 1;
  1038.             }
  1039.             this.clip.eyeClip.eyeL.gotoAndStop(_loc8_ + this.eyes.lO);
  1040.             this.clip.eyeClip.eyeR.gotoAndStop(_loc8_ + this.eyes.rO);
  1041.          }
  1042.          if(this.phase == 6)
  1043.          {
  1044.             this.clip.eyeClip.eyeL.gotoAndStop(13 + this.eyes.lO);
  1045.             this.clip.eyeClip.eyeR.gotoAndStop(13 + this.eyes.rO);
  1046.          }
  1047.          this.oldF = this.clip.eyeClip.eyeL._currentframe - this.eyes.lO;
  1048.          var _loc5_ = Math.round((_root[_root.char].x - this.x + 100) / 20) + 1;
  1049.          if(_loc5_ < 1)
  1050.          {
  1051.             _loc5_ = 1;
  1052.          }
  1053.          if(_loc5_ > 11)
  1054.          {
  1055.             _loc5_ = 11;
  1056.          }
  1057.          this.eyes.lO = _loc5_ > 4 ? 14 : 0;
  1058.          this.eyes.rO = _loc5_ < 8 ? 14 : 29;
  1059.          if(_loc5_ <= 5)
  1060.          {
  1061.             this.dir = "L";
  1062.          }
  1063.          else if(_loc5_ >= 7)
  1064.          {
  1065.             this.dir = "R";
  1066.          }
  1067.          else
  1068.          {
  1069.             this.dir = "F";
  1070.          }
  1071.          if(this.f2 == "astroAttacking" && this.c > 50 && this.c < 90)
  1072.          {
  1073.             if(this.eyes.lO == 0)
  1074.             {
  1075.                this.clip.eyeClip.eyeL.gotoAndStop(this.c);
  1076.             }
  1077.             else
  1078.             {
  1079.                this.clip.eyeClip.eyeL.gotoAndStop(this.c + 40);
  1080.             }
  1081.             if(this.eyes.rO == 29)
  1082.             {
  1083.                this.clip.eyeClip.eyeR.gotoAndStop(this.c + 80);
  1084.             }
  1085.             else
  1086.             {
  1087.                this.clip.eyeClip.eyeR.gotoAndStop(this.c + 40);
  1088.             }
  1089.          }
  1090.          this.clip.eyeClip.gotoAndStop(_loc5_);
  1091.       }
  1092.       if(this.nudging)
  1093.       {
  1094.          this.xA *= 0.5;
  1095.          this.yA *= 0.5;
  1096.          this.nc = this.nc + 1;
  1097.          if(this.nc == 15)
  1098.          {
  1099.             this.xA = this.yA = 0;
  1100.             this.nudging = false;
  1101.          }
  1102.       }
  1103.       var _loc4_ = 0;
  1104.       var _loc9_ = _root.broShots.length;
  1105.       while(_loc4_ < _loc9_)
  1106.       {
  1107.          var _loc7_ = _root.broShots[_loc4_] + "Clip";
  1108.          if(this.clip.head.hitTest(_root[_loc7_]) && this.f2 != "intro")
  1109.          {
  1110.             var _loc3_ = _root.broShots[_loc4_];
  1111.             var _loc6_ = this.life;
  1112.             if(this.f2 != "dying")
  1113.             {
  1114.                if(this.permitHit)
  1115.                {
  1116.                   this.life -= _root[_loc3_].power;
  1117.                   if(this.life < 1)
  1118.                   {
  1119.                      this.f2 = "death";
  1120.                   }
  1121.                   else
  1122.                   {
  1123.                      this.nudge(_root[_loc3_].xMov,_root[_loc3_].yMov,10);
  1124.                      _root.audio.playLevel4("deathHit" + (random(3) + 1),_root.randRange(14,22));
  1125.                      if(this.f2 != "furious" && this.f2 != "walling" && this.f2 != "furious2" && this.f2 != "deathBallAttacking" && this.f2 != "creatingEnemies")
  1126.                      {
  1127.                         if(random(10) == 0)
  1128.                         {
  1129.                            this.fury2();
  1130.                         }
  1131.                         else
  1132.                         {
  1133.                            this[this.axis + "MovT"] = 0;
  1134.                            this.axis = random(10) <= 4 ? "y" : "x";
  1135.                            this[this.axis + "MovT"] = random(2) <= 0 ? -1 * this.speed : this.speed;
  1136.                            this.getDirString();
  1137.                         }
  1138.                      }
  1139.                      this.speed = this.speedOrig = 20 - Math.round(this.life / (this.lifeOrig / 10));
  1140.                      this.cv = 0.25 + (this.lifeOrig - this.life) / 10000;
  1141.                      _loc5_ = Math.round(100 * ((this.lifeOrig - this.life) / this.lifeOrig));
  1142.                      this.clip.eyeClip.eyeL.pulse._alpha = _loc5_;
  1143.                      this.clip.eyeClip.eyeR.pulse._alpha = _loc5_;
  1144.                      this.clip.skull.gotoAndPlay("f" + (random(3) + 1));
  1145.                   }
  1146.                }
  1147.                else
  1148.                {
  1149.                   _root.audio.playLevel4("deathHitNull" + (random(3) + 1),_root.randRange(32,38));
  1150.                   if(_root.chars.length < 20)
  1151.                   {
  1152.                      this["createEnemy" + this.phase](_root[_loc3_].dir);
  1153.                   }
  1154.                }
  1155.             }
  1156.             else
  1157.             {
  1158.                _root.audio.playLevel4("deathHit" + (random(3) + 1),_root.randRange(14,22));
  1159.             }
  1160.             _root[_root.char].fc = _root[_root.char].fireFreq - _root.rapidVar;
  1161.             _root[_loc3_].exploX = this.x + this.clip._width / 2;
  1162.             _root[_loc3_].exploY = this.y + this.clip._height / 2;
  1163.             _root[_loc3_].hit(_loc6_);
  1164.             break;
  1165.          }
  1166.          _loc4_ = _loc4_ + 1;
  1167.       }
  1168.       if(this.clip.head.hitTest(_root[_root.char + "Clip"]) && this.f2 != "intro" && this.f2 != "dying")
  1169.       {
  1170.          _root[_root.char].hit(this.xMov,this.yMov,100,this.power);
  1171.       }
  1172.       if(this.f2 != "walling" && this.f2 != "dying")
  1173.       {
  1174.          var _loc10_ = false;
  1175.          if(this.x > 950)
  1176.          {
  1177.             _loc10_ = true;
  1178.             this.dir = "L";
  1179.          }
  1180.          else if(this.x < 50)
  1181.          {
  1182.             _loc10_ = true;
  1183.             this.dir = "R";
  1184.          }
  1185.          else if(this.y < 50)
  1186.          {
  1187.             _loc10_ = true;
  1188.             this.dir = "D";
  1189.          }
  1190.          else if(this.y > 550)
  1191.          {
  1192.             _loc10_ = true;
  1193.             this.dir = "U";
  1194.          }
  1195.          if(_loc10_)
  1196.          {
  1197.             this.xMovT = 0;
  1198.             this.yMovT = 0;
  1199.             this.axis = !(this.dir == "L" || this.dir == "R") ? "y" : "x";
  1200.             this[this.axis + "MovT"] = !(this.dir == "L" || this.dir == "U") ? this.speed : -1 * this.speed;
  1201.          }
  1202.       }
  1203.       else
  1204.       {
  1205.          if(this.y < -50)
  1206.          {
  1207.             this.y = 620;
  1208.          }
  1209.          if(this.y > 650)
  1210.          {
  1211.             this.y = -40;
  1212.          }
  1213.       }
  1214.       if(this.xMovT < this.xMov)
  1215.       {
  1216.          this.xMov -= this.cv;
  1217.       }
  1218.       else if(this.xMovT > this.xMov)
  1219.       {
  1220.          this.xMov += this.cv;
  1221.       }
  1222.       else
  1223.       {
  1224.          this.xMov = this.xMovT;
  1225.       }
  1226.       if(this.yMovT < this.yMov)
  1227.       {
  1228.          this.yMov -= this.cv;
  1229.       }
  1230.       else if(this.yMovT > this.yMov)
  1231.       {
  1232.          this.yMov += this.cv;
  1233.       }
  1234.       else
  1235.       {
  1236.          this.yMov = this.yMovT;
  1237.       }
  1238.       this.x += this.xMov + this.xA;
  1239.       this.y += this.yMov + this.yA + 1 * Math.sin(this.hc += 0.05);
  1240.       this.clip._x = this.x;
  1241.       this.clip._y = this.y;
  1242.    }
  1243. }
  1244.